A locking device, by way of example, for switch panels is known from Section “8.2.4 Metallgekapselte luftisolierte Schaltfelder nach DIN EN 60298 (VDE 0670, Teil 6) [Metal encapsulated, air-insulated switch panels in accordance with DIN EN 60298 (VDE 0670, Part 6]” of the “ABB-Taschenbuch Schaltanlagen [ABB Manual on Switchgear Assemblies]”, 10th Edition, Cornelsen Verlag Berlin, [page 392. This describes a metal-compartmentalized switch panel, which is subdivided into a number of area elements, such as a busbar area, a cable connecting area and a switch area. An electrical switch is arranged in the switch area. This electrical switch can be moved between an operating position, a test position and a disconnected position. In the disconnected position, the connecting pieces of the electrical switch are electrically disconnected from corresponding mating contact pieces, and the secondary lines are disconnected by means of a plug connection. In the test position, the connecting pieces of the switch are disconnected from the mating contact pieces. In this position, the secondary cables of the switch and switch panel are connected to one another via the plug connection. In the operating position, the connecting pieces of the switch make contact with the mating contact pieces. The secondary cables are connected to one another by means of the plug connection. The connecting pieces of the electrical switch are in this case arranged such that, in the operating position, they project through openings, which are provided in a partition wall, into the busbar area and/or into the cable connecting area. These openings can be closed by means of shutters in order to ensure that the partition wall has a compartmentalization effect even in the case of an electrical switch which is at a remote distance or is in the disconnected or test position. The movement of the electrical switch on the mounting rack between the operating position, the test position and the disconnected position is produced by means of complex mechanical apparatuses. Appropriate assemblies engage in these complex mechanical apparatuses in order to produce a lock in certain states, in accordance with the applicable safety regulations. If an additional drive, for example for a grounding switch, is intended to be provided in the switch panel, then further locks must be provided.